﻿using SqlSugar;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace XinLife.Model
{
    /// <summary>
    /// 用户权限表
    /// </summary>
    [Table("tb_authorize")]
    [SugarTable("tb_authorize")]
    public class Authorize
    {
        /// <summary>
        ///  授权功能主键ID
        /// </summary>
        [Key]
        [SugarColumn(IsPrimaryKey = true)]
        public string cId { get; set; }

        /// <summary>
        /// 对象分类:1-角色2-用户
        /// </summary>
        public int cObjectType { get; set; }
        /// <summary>
        /// 对象主键.
        /// </summary>
        public string cObjectId { get; set; }
        /// <summary>
        /// 项目ID.例如菜单ID 按钮ID
        /// </summary>
        public string cItemId { get; set; }
        /// <summary>
        /// 项目类型:1-菜单2-按钮
        /// </summary>
        public int cItemType { get; set; }
        /// 创建人
        /// </summary>
        public string cCreatedBy { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? cCreatedDate { get; set; }

        [SugarColumn(IsIgnore = true)]
        public virtual Role Role { get; set; }
        [SugarColumn(IsIgnore = true)]
        public virtual Module Module { get; set; }
        [SugarColumn(IsIgnore = true)]
        public virtual ModuleButton ModuleButton { get; set; }

    }
}
